package tr.edu.yildiz.ce.app_manager.ui.action.table;

import com.vaadin.ui.Table;

import tr.edu.yildiz.ce.app_manager.model.AppProxy;
import tr.edu.yildiz.ce.app_manager.model.Application;
import tr.edu.yildiz.ce.app_manager.ui.AppManagerApplication;
import tr.edu.yildiz.ce.app_manager.ui.components.form.ApplicationForm;
import tr.edu.yildiz.ce.app_manager.ui.components.form.ProxyForm;

public class ProxyTableSelectAction extends TableAction{

	Long id;
	AppProxy proxy;
	
	public AppProxy getProxy() {
		return proxy;
	}
	
	public ProxyTableSelectAction(AppManagerApplication app,Long id) {
		super(app);
		this.id = id;
	}

	@Override
	public void doAction() {
		proxy = app.getServiceProvider().getAppProxyService().get(id);
		ProxyForm form = new ProxyForm(proxy,app);
		app.getMainLayout().setForm(form);
		
	}

}
